!!!
%html
  %body
    .span15
      .container
        .col-md-12
          .row
            .page-header
              %h1
                Customers
            .row
              .col-md-10.pull-left
                The following are a list of customers currently configured in Hashview. All Jobs, passwords and hashes will be assigned to a single customer. Deleting a customer will remove ALL data from the system.
              .col-md-2.pull-right
                %a.btn.btn-primary.pull-left{href: '/customers/create'}
                  Add a New Customer
      %br
      %br
      .container
        .row
          .col-md-12
            .table
              %table{class: 'table table-striped'}
                %thead
                  %tr
                    %th
                      %b Name
                    %th
                      %b Description
                    %th
                      %b Control
                %tbody
                  - if @customers
                    - @customers.each do |customer|
                      %tr
                        %td #{customer.name}
                        %td #{customer.description}
                        %td
                          %a.btn.btn-warning{href: "/customers/edit/#{customer.id}"}
                            %i.glyphicon.glyphicon-cog{title: 'Edit'}
                          %a.btn.btn-danger{href: "#modal#{customer.id}", "data-toggle" => 'modal'}
                            %i.glyphicon.glyphicon-trash{title: 'Delete'}
                          .modal.fade.modal{id: "modal#{customer.id}", role: 'dialog', tabindex: '-1', "aria-hidden" => 'true'}
                            .modal-dialog.modal-lg
                              .modal-content
                                .modal-header
                                  %button.close{"aria-label" => 'Close', "data-dismiss" => 'modal', type: 'button'}
                                    %span{"aria-hidden" => 'true'} &times;
                                  %h4.modal-title Remove #{customer.name}?
                                .modal-body
                                  %p
                                    By confirming, you will delete all instances related to this customer including the following:
                                  %br
                                  .table
                                    %table{class: 'table'}
                                      %tr
                                        %td Total Associated Jobs: #{@total_jobs[customer.id]}
                                      %tr
                                        %td Total Associated HashFiles: #{@total_hashfiles[customer.id]}
                                      %tr 
                                        %td
                                .modal-footer
                                  %button.btn.btn-default{"data-dismiss" => 'modal', type: 'button'} Close
                                  %a.btn.btn-danger{type: 'button', href: "/customers/delete/#{customer.id}"} Confirm
